const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');

const app = 'video.js'
module.exports = {
    entry: {
        app: `./apps/${app}/index.js`,
    },
    devtool: 'inline-source-map',
    plugins: [
        new CleanWebpackPlugin({
            dry: true
        }),
        new HtmlWebpackPlugin({
            title: app,
            template: `./apps/${app}/index.html`,
        })
    ],
    output: {
        filename: '[name].bundle.js',
        path: path.resolve(__dirname, 'dist'),
        publicPath: '/'
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [
                    'style-loader',
                    'css-loader'
                ]
            },
            {
                test: /\.(png|svg|jpg|gif)$/,
                use: [
                    'file-loader'
                ]
            }
        ]
    }
};